<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>系统用户管理</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<script>document.write('<script src="../../plugin/vue/js/import.js?' + Math.random() + '"><' + '/script>');</script>

<script>
	_import("../../plugin/vue/js/before.js");
</script>
<script>_import("../../plugin/webuploader/webuploader.js");</script>
	<link rel="stylesheet" type="text/css" href="../../plugin/webuploader/webuploader.css"/>
<!-- 
<script src="../../plugin/vue/js/xlsx.full.min.js"></script>
 -->
<style>
[v-cloak]{
	display:none !important;
}
.el-form-item {
    margin-bottom: 0px;
}
.w-tableinput .el-checkbox {
    margin: 0 15px 0 0;
    min-width: auto; max-width:120px;
}
.el-dialog__body { padding: 0 20px;}
.el-radio.is-bordered { padding: 8px 10px 0 8px;  height: 32px;}
.el-radio{ margin-right: 5px; }
/* .el-dialog__header { padding: 10px 20px 10px;}
.el-dialog__headerbtn { top: 10px;} */
.w-tableinputw label.el-checkbox{width:100px;}
.w-tableinputw .el-form-item__content{max-width:580px;}
</style>
</head>
<body>
	<div class="w-h100" id="app" v-cloak>
	    <div class="left_side" v-if="show_bar">
	              <div class="panel panel-default">
						<div class="panel-heading" id="panel-heading-div">
							<h3 class="panel-title">
								<i class="icon-user"></i>部门结构
							</h3>
						</div>
						<div class="panel-body w-jheight">
						<!-- 
						<el-input
						  placeholder="输入关键字进行过滤"
						  v-model="filterText">
						</el-input> 
						 --> 
						    <el-tree   ref="tree" class="filter-tree w-filter-tree"  :filter-node-method="filterNode"  node-key="id"  :default-expanded-keys="[parseInt(curTreeId)]"  :data="treelist" :props="defaultProps"  @node-click="handleNodeClick"></el-tree>
						</div>
					</div>
	    </div>
	    <div class="toggle">
			<div class="bar-con-l" @click="toggle_bar">
				<div class="bar"></div>
			</div>
		</div>
	    <div class="right_side">
					<div class="panel panel-default">
						<div class="panel-heading" id="panel-heading-div">
							<h3 class="panel-title">
								<i class="icon-user"></i>系统用户管理
							</h3>
	
							
						</div>
						<div>
								<!--  
									 <el-button type="primary" size="small" @click="exportForm" v-if="userlist.length>0">导出</el-button>
									 -->
							<a href="" download="用户管理.xlsx" id="exp"></a>
						</div>
						<div class="panel-body w-jheight" style="clear:both;">	
					         <div class="w-usermtitle">
								  <span>
								   [{{deptName}}]
								   <em v-if="msg!=''" style="color:red">{{msg}}</em>
								   </span>	
								   <el-button type="primary" @click="editForm('add')" v-if="addEnable" class="fr w-mt2">添加</el-button>
								   <el-button type="primary" @click="importUser()" class="fr w-mt2" style="margin-right:5px;">导入</el-button>
								   <div id="uploader" class="wu-example" style="display:none;">
			                      		<div id="thelist" class="uploader-list"></div>
			                      		<div class="btns">
			                      			<div id="picker">导入</div>
			                      			<!-- 
			                      			<span style="color:red;">导入文件不能超过5M</span>   
			                      			 -->          			
			                      		</div>
                      				</div>
								  <div class="w-userinput">
							      <el-input  placeholder="请输入姓名"  v-model="realName" class="input-with-select"
								    @keyup.enter.native="searchByRealName">
								   	<el-button slot="append" title="搜索" icon="el-icon-search" @click="searchByRealName"></el-button>
								   </el-input>						
									</div>
									
								</div>   									 					  
									<el-table :data="userlist"  border v-loading="loading"
							 			style="width: 100%"				 		
								        :row-class-name="tableRowClassName"
								        @selection-change="handleSelectionChange"
								        :default-sort = "{prop: 'deptId', order: 'ascending'}"
								        @row-dblclick="handleRowDbClick"
								        >					 
								 <!-- <el-table-column   type="selection" width="50"></el-table-column> -->
								 <el-table-column	prop="userName" label="登录名" sortable :formatter="formatterUserName"></el-table-column> 
								 <el-table-column	prop="realName" label="姓名">
								 
									 <template slot-scope="scope">
									      <el-input  v-if="editable[scope.$index]" v-model="scope.row.realName" placeholder="请输入姓名"></el-input>
									      <span  v-else >{{scope.row.realName}}</span>
									 </template>		
									 			 
								 </el-table-column>
								 <el-table-column	prop="deptName" label="部门"> </el-table-column>
								 <el-table-column	prop="roleListName" label="角色"> </el-table-column>
								 <el-table-column	prop="dutyCodeName" label="岗位名称"> </el-table-column>
								 <el-table-column	prop="dutyFlagName" label="是否负责人"> </el-table-column>
							     <el-table-column   fixed="right"    label="操作"  width="100">
								      <template slot-scope="scope">
								      <div v-if="!editable[scope.$index]">
									       <i class="el-icon-edit"  title="编辑"  @click="edit(scope.row)"></i>
									       <i class="el-icon-setting"  title="重置密码" @click="reset(scope.row)"></i>
									       <i class="el-icon-delete" title="删除"  @click="del(scope.row)"></i>
								       </div>
								       <div  v-else >					        
								            <el-button type="primary"  title="保存"  icon="el-icon-check" circle size="mini" @click="save(scope.row)"></el-button>
								            <el-button type="danger"  title="取消"  icon="el-icon-close" circle size="mini"  @click="cancel(scope.row)"></el-button>
								       </div>
								      </template>
			    				</el-table-column>	 
								 
							 </el-table>
			             
							<div class="block mt10">
								<el-pagination @size-change="handleSizeChange"
									@current-change="handleCurrentChange"
									:current-page="currentPageNbr" :page-sizes="pageSizes"
									:page-size="pageSize" class="w-tc"
									layout="total, sizes, prev, pager, next, jumper"
									:total="totalRecords"> </el-pagination>
							</div>
							
					  
						</div>
					</div>
               </div>
               
               
             	<!-- Form -->	
				<el-dialog title="用户信息维护" width="860px" :visible.sync="dlForm"  :close-on-click-modal="false" @close="dlClose('form')">
                             <el-dialog
							      width="30%"							  
							      title="部门结构"
							      :visible.sync="dlTreeForm"
							      append-to-body
							      @close="dlTreeClose()" :close-on-click-modal="false">						      
							      
							                      <div style="height:150px;overflow-y:auto;">                           
											        <el-tree
											          ref="treeForm"
												      :data="treeForm.treelist"												     
												      node-key="id"
												      default-expand-all
												      :expand-on-click-node="true">
												     
												      <el-radio-group v-model="treeForm.id" class="custom-tree-node" slot-scope="{ node, data }">
														    <el-radio :label="data.id" @change="dlTreeGetDeptName(node,data)"> {{ node.label }}</el-radio>
														   
                                                      </el-radio-group>												        
												        
												    </el-tree>
							      				</div>
													  <div slot="footer" class="dialog-footer">
													    <el-button @click="dlTreeCancel()">取 消</el-button>							    
													    <el-button type="primary" @click="dlTreeSave()">确定</el-button>
													  </div>
							      
							 </el-dialog>

							<div style="height:373px;overflow-y:auto;"> 
							<el-form ref="form" :model="form"  :rules="form.rules" :inline="true"> <!-- label-width="82px" -->
									  <el-tabs v-model="activeTab" @tab-click="handleClick">
									    <el-tab-pane label="帐号分配" name="tab1">
									    	<el-row :gutter="24" class="mb5">  
										    	<el-col :span="12">
											    	<el-form-item label="登录名：" label-width="95px" :rules="[{required: true}]">
											   			<el-input v-model="form.username" :disabled="form.userNameC"></el-input>
											  		</el-form-item>
										  		</el-col>
									  		</el-row>
									  		<el-row :gutter="24" class="mb5"> 
									  			<el-col :span="12"> 
											  		<el-form-item label="真实姓名：" label-width="95px" :rules="[{required: true}]">
											    		<el-input v-model="form.realname"></el-input>
											  		</el-form-item>
										  		</el-col>
											</el-row>
											<el-row :gutter="24" class="mb5"> 
									  			<el-col :span="12"> 
											  		<el-form-item label="笔名：" label-width="95px">
											    		<el-input v-model="form.penname"></el-input>
											  		</el-form-item>
										  		</el-col>
											</el-row>
											<el-row :gutter="24" class="mb5">
												<el-col :span="24">
											  		<el-form-item label="用户角色：" class="w-tableinput w-tableinputw" label-width="95px" :rules="[{required: true}]">
												     <el-checkbox-group v-model="form.roles">
												     	<el-checkbox v-for='item in form.rolelist' :label='item.roleid' name="roles">
					    						    	{{item.rolename}}
					    						    	</el-checkbox>
												     </el-checkbox-group>
					                          		</el-form-item>
				                          		</el-col>
											</el-row>
											
											<el-row :gutter="24" class="mb5">
												<el-col :span="12">
					                          		<el-form-item label="所属部门："  v-if="form.curDeptFlag" label-width="95px">
					                          		
													    <el-cascader  :options="cascaderdept.depts" v-model="cascaderdept.curdept"
														 :show-all-levels="cascaderdeptOpt.showallevels" :change-on-select="cascaderdeptOpt.changeonselect"
														 :filterable="cascaderdeptOpt.filterable"  :props="cascaderdeptOpt.defaultProps"
														 :clearable="cascaderdeptOpt.clearable" @change="curDeptChg">
									  					</el-cascader>
									  					
									  					<!--  groupCode 0  deptCode 当前层id
													    <el-input v-model="form.curDeptName" :readOnly="form.curDeptNameC" class="input-with-select">
														    <el-button v-if="deptAdjust" slot="append" title="所属部门选择" icon="el-icon-search" @click="dlTreeFrom('curDept')"></el-button>
													    </el-input>
													     -->
													    												    
											  		</el-form-item>
										  	    </el-col>
									  		</el-row>
									  		
									  		<el-row :gutter="24" class="mb5">
									  			<el-col :span="12">
												    <el-form-item label="操作范围："  v-if="form.operDeptFlag" label-width="95px">
												      <el-cascader  :options="cascaderdept.depts" v-model="cascaderdept.operdept"
														 :show-all-levels="cascaderdeptOpt.showallevels" :change-on-select="cascaderdeptOpt.changeonselect"
														 :filterable="cascaderdeptOpt.filterable"  :props="cascaderdeptOpt.defaultProps"
														 :clearable="cascaderdeptOpt.clearable" @change="operDeptChg">
									  					</el-cascader>
									  				  <!--  
												      <el-input v-model="form.operDeptName" :readOnly="form.operDeptNameC" class="input-with-select">
												      	<el-button slot="append" title="操作部门选择" icon="el-icon-search" @click="dlTreeFrom('operDept')"></el-button>
												      </el-input>
												      -->	
												  	</el-form-item>	
											  	</el-col>
										  	</el-row>
										  	 
										  	<el-row :gutter="24" class="mb5">	
										  		<el-col :span="20">								  	
												  	<el-form-item label="查看范围：" v-if="showRang!=0" label-width="95px" :rules="[{required: true}]">
												       <el-radio-group v-model="form.rank" class="w-tableinput" >									      
													        <el-radio border v-for='item in form.ranks' :label='item.code' >
													        	{{item.codedesc}}
							    						    </el-radio>
											       		</el-radio-group>
											  		</el-form-item> 
										  		</el-col>
									  		</el-row>
									  		
									  		<el-row :gutter="24" class="mb5">
									  			<el-col :span="12">
											  		<el-form-item label="显示顺序：" label-width="95px">
											    		<el-input-number :value="0" :min="0" v-model="form.displayOrder"></el-input-number>
											  		</el-form-item>
										  		</el-col>
										  	</el-row>
									    </el-tab-pane>
									    <el-tab-pane label="基本信息维护" name="tab2">
									    	<el-row :gutter="24" class="mb5">
									    		<el-col :span="12">
									    			<el-form-item label="出生日期：" label-width="95px">
										    			<el-date-picker
													      v-model="form.birth"
													      type="date"
													      placeholder="选择日期" :clearable="false">
													    </el-date-picker>
												    </el-form-item>
									    		</el-col>
									    	</el-row>
									    	<el-row :gutter="24" class="mb5">
									    		<el-col :span="12">
											    	<el-form-item label="性别：" label-width="95px" :rules="[{required: true}]">
											     		<el-radio-group v-model="form.sex">
												       		<el-radio border v-for='item in form.sexlist' :label='item.code'>
												        		{{item.codedesc}}
					    						    		</el-radio>
												    	</el-radio-group>
													</el-form-item>
												</el-col>
											</el-row>
											<!-- 岗位编号 -->
											<el-row :gutter="24" class="mb5">
												<el-col :span="12">
											    	<el-form-item label="所在岗位：" label-width="95px">
											    		<el-select style="width:100%" v-model="form.dutyCode" placeholder="请选择" @change="changegw">  <!--  @change="getRws"  -->
														    <el-option-group
														      v-for="duty in duties"
														      :key="duty.gwfl"
														      :label="duty.gwfl_name">
														      <el-option
														        v-for="item in duty.detaillist"
														        :key="item.gwid"
														        :label="item.gwmc"
														        :value="item.gwid">
														      </el-option>
														    </el-option-group>
														</el-select> 												
													</el-form-item>
												</el-col>
											</el-row>
											
											<el-row :gutter="24" class="mb5">
												<el-col :span="12">
											    	<el-form-item label="兼职岗位：" label-width="95px">
											    		<el-select style="width:100%" v-model="form.dutyCode2" placeholder="请选择" multiple> 
														    <el-option-group
														      v-for="duty in duties2"
														      :key="duty.gwfl"
														      :label="duty.gwfl_name">
														      <el-option
														        v-for="item in duty.detaillist"
														        :key="item.gwid"
														        :label="item.gwmc"
														        :value="item.gwid">
														      </el-option>
														    </el-option-group>
														</el-select> 												
													</el-form-item>
												</el-col>
											</el-row>
											
											<!-- 是否考核 -->
									    	<el-row :gutter="24" class="mb5" v-if="khSet">
									    		<el-col :span="12">
											    	<el-form-item label="参与考核：" label-width="95px">
											    		<el-radio-group v-model="form.kpJoin" >
												       		<el-radio border v-for='item in form.kpjlist' :label='item.kpjvalue'>
												        		{{item.kpjdesc}}
					    						    		</el-radio>
												    	</el-radio-group>
											    	</el-form-item>
									    		</el-col>
									    	</el-row>
									    	<el-row :gutter="24" class="mb5">
												<el-col :span="12">
													<el-form-item label="部门负责人：" label-width="95px">
														<el-radio-group v-model="form.dutyFlag" >
												       		<el-radio border v-for='item in form.dutyflist' :label='item.dutyvalue' @change="dutyChg">
												        		{{item.dutydesc}}
					    						    		</el-radio>
												    	</el-radio-group>						
													</el-form-item>
												</el-col>
											</el-row>
											
											
									        <el-row :gutter="24" class="mb5" v-if="khSet">
									        	<el-col :span="20">
													<el-form-item label="评审级别：" label-width="95px">
														<el-radio-group v-model="form.kpPerson" >
												       		<el-radio border v-for='item in form.kpplist' :label='item.kppvalue' :disabled="item.kppValue!=1&&form.kppDisable" @change="kppChg">
												        		{{item.kppdesc}}
					    						    		</el-radio>
												    	</el-radio-group>						
													</el-form-item>
												</el-col>
											</el-row>
											
											<el-row :gutter="24" class="mb5" v-if="form.showScope">
									        	<el-col :span="20">
													<el-form-item label="评审范围：" label-width="95px">
														<el-select v-model="form.psscope" multiple placeholder="请选择">
														    <el-option
														      v-for="item in scopes"
														      :key="item.code"
														      :label="item.code_desc"
														      :value="item.code">
														    </el-option>
														 </el-select>		
													</el-form-item>
												</el-col>
											</el-row>
											
											
											<!-- 负责人电话 -->
											<el-row :gutter="24" class="mb5">
												<el-col :span="12">
													<el-form-item label="联系电话：" label-width="95px">
														<el-input v-model="form.phone"></el-input>
													</el-form-item>
												</el-col>
											</el-row>
											
									    	<!-- 考核任务数 
									    	<el-row :gutter="24" class="mb5">
												<el-col :span="12">
											    	<el-form-item label="任务数：" label-width="95px">
														<el-input v-model="form.taskNum"></el-input>
													</el-form-item>
												</el-col>
											</el-row>
											-->
											
									    </el-tab-pane>
									    
									    <!-- 
									    <el-tab-pane label="考核人员设置" name="tab3" v-if="khSet">
									         -->
									    	
									    	<!-- 岗位编号 -->
									    	<!-- 
									    	<el-form-item label="岗位">
									    		<el-select style="width:100%" v-model="form.dutyCode" @change="getRws" placeholder="请选择">
												    <el-option-group
												      v-for="duty in duties"
												      :key="duty.gwfl"
												      :label="duty.gwfl_name">
												      <el-option
												        v-for="item in duty.detaillist"
												        :key="item.gwid"
												        :label="item.gwmc"
												        :value="item.gwid">
												      </el-option>
												    </el-option-group>
												</el-select>
												
											</el-form-item>  -->
									    	<!-- 考核任务数 -->
									    	<!--  
									    	<el-form-item label="任务数" prop="taskNum">
												<el-input v-model="form.taskNum"></el-input>
											</el-form-item>
									    	-->
									    	<!-- 考评分类 
									    	<el-row :gutter="24">
									    		<el-col :span="12">
										    	<el-form-item label="考评分类：" label-width="82px">
													<el-select v-model="form.kpClass" multiple placeholder="请选择">
													    <el-option
													      v-for="item in form.jxkplist"
													      :key="item.jxkpValue"
													      :label="item.jxkpDesc"
													      :value="item.jxkpValue">
													    </el-option>
													 </el-select>												
												</el-form-item>
												</el-col>
											</el-row>											
									    </el-tab-pane>
									    -->
  									  </el-tabs>				  
									  
									</el-form>
							 
							 </div>
							
							 
							  <div slot="footer" class="dialog-footer">
							    <el-button @click="dlCancel('form')">取 消</el-button>							    
							    <el-button type="primary" @click="dlSave('form')">保存</el-button>
							  </div>
				</el-dialog>
				<!-- Form -->  
               
               
	
	</div>
	
	

	



</body>
<script>
	_import("../../plugin/vue/js/after.js");
	//_import("../../plugin/js/user.js");
</script>
<script>
	_import("js/userInfoList.js");
	//height
	var wHight = $(window).height()-50;
	var bHight = wHight + "px";
	$(".w-jheight").css("height",bHight);
</script>
</html>